/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.udc.emarketapp.emarket.model.usersFacade.actions;

import es.udc.emarketapp.emarket.model.seller.dao.SQLSellerDAO;
import es.udc.emarketapp.emarket.model.seller.dao.SQLSellerDAOFactory;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.sql.NonTransactionalPlainAction;
import java.sql.Connection;

public class FindSellerByIdAction implements NonTransactionalPlainAction {

	private String idSeller;

	public FindSellerByIdAction(String idSeller) {

		this.idSeller = idSeller;
	}

	public Object execute(Connection connection)
			throws InstanceNotFoundException, InternalErrorException {

		SQLSellerDAO sellerDAO = SQLSellerDAOFactory.getDAO();

		return sellerDAO.findById(connection, idSeller);
	}
}
